package com.boot.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.boot.entity.User;
import com.boot.mapper.UserMapper;
import com.boot.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Description:
 * @Author: HuangX
 * @Date: 2021/3/25
 */
@Slf4j
//@Service
@Transactional(rollbackFor = Exception.class)
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Async
    @Override
    public void getUser() {
        System.out.println("+++++++++getUser异步方法开始执行+++++++");
        User user = this.baseMapper.selectById(1374964472170422273L);
        System.out.println("user = " + user);
    }
}
